﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;
using PersonalHealth.Data.Model;

namespace PersonalHealth.Data.Data
{
    public class HealthContext : DbContext
    {
        public HealthContext()
            : base("HealthEntities")
        {
            this.Configuration.LazyLoadingEnabled = true;
            this.Configuration.ProxyCreationEnabled = true;
        }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            BloodTypes = Set<BloodType>();
            Departments = Set<Department>();
            Enterprises = Set<Enterprise>();
            EnterpriseTypes = Set<EnterpriseType>();
            Measure_BG = Set<Measure_BG>();
            Measure_BO = Set<Measure_BO>();
            Measure_BP = Set<Measure_BP>();
            Measure_ECG = Set<Measure_ECG>();
            Measure_Temp = Set<Measure_Temp>();
            MeasureConditions = Set<MeasureCondition>();
            MeasureSubTypes = Set<MeasureSubType>();
            MeasureTypes = Set<MeasureType>();
            Messages = Set<Message>();
            OfficalDataThresholds = Set<OfficalDataThreshold>();
            PersonalDataThresholds = Set<PersonalDataThreshold>();
            Positions = Set<Position>();
            Sexes = Set<Sex>();
            Users = Set<User>();
            Tasks = Set<Task>();
            HealthReports = Set<HealthReport>();
        }

        public DbSet<BloodType> BloodTypes { get; set; }
        public DbSet<Department> Departments { get; set; }
        public DbSet<Enterprise> Enterprises { get; set; }
        public DbSet<EnterpriseType> EnterpriseTypes { get; set; }
        public DbSet<Measure_BG> Measure_BG { get; set; }
        public DbSet<Measure_BO> Measure_BO { get; set; }
        public DbSet<Measure_BP> Measure_BP { get; set; }
        public DbSet<Measure_ECG> Measure_ECG { get; set; }
        public DbSet<Measure_Temp> Measure_Temp { get; set; }
        public DbSet<MeasureCondition> MeasureConditions { get; set; }
        public DbSet<MeasureSubType> MeasureSubTypes { get; set; }
        public DbSet<MeasureType> MeasureTypes { get; set; }
        public DbSet<Message> Messages { get; set; }
        public DbSet<OfficalDataThreshold> OfficalDataThresholds { get; set; }
        public DbSet<PersonalDataThreshold> PersonalDataThresholds { get; set; }
        public DbSet<Position> Positions { get; set; }
        public DbSet<Sex> Sexes { get; set; }
        public DbSet<User> Users { get; set; }
        public DbSet<Task> Tasks { get; set; }
        public DbSet<HealthReport> HealthReports { get; set; }
    }
}
